package cre.spring.boot.v1.mybatis;

import org.apache.ibatis.io.ResolverUtil;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

import java.util.Set;

/**
 * @Author guchenbo
 * @Date 2019/2/27.
 */
@SpringBootApplication
//@MapperScan(basePackages = "cre.spring.boot.v1.mybatis")
public class DemoApplication {

    public static void main(String[] args) {
        // FIXME: 2019/3/24
        System.out.println("test mybatis alias");
        ResolverUtil<Class<?>> resolverUtil = new ResolverUtil<Class<?>>();
        resolverUtil.find(new ResolverUtil.IsA(Object.class), "cre.spring.boot.v1.mybatis.po");
        Set<Class<? extends Class<?>>> typeSet = resolverUtil.getClasses();
        for(Class<?> type : typeSet){
            // Ignore inner classes and interfaces (including package-info.java)
            // Skip also inner classes. See issue #6
            if (!type.isAnonymousClass() && !type.isInterface() && !type.isMemberClass()) {
                System.out.println(type.getName());
            }
        }

        SpringApplication.run(DemoApplication.class, args);
    }
}
